package com.ruoyi.web.controller.message;

import com.ruoyi.common.core.domain.AjaxResult;


import com.ruoyi.kafka.KafkaProducerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.Future;

@RestController
@RequestMapping("/kafka")
public class SendKafkaMessageController {
    @Autowired
    private KafkaProducerService kafkaProducerService;

    @GetMapping("/sendmsg")
    public AjaxResult sendMsg(String message)
    {
        kafkaProducerService.send("------测试消息----snedKafkamessage---from controller-----message:"+message);
        return AjaxResult.success("send ok...");
    }
}
